<link rel="stylesheet" href="<?php echo base_url() ?>css/shoutstyle.css" type="text/css" media="screen" title="no title" charset="utf-8">
<style type="text/css" media="screen">
	.clear{
		clear:both;
	}
	.clear10{
		clear:both;
		height:10px;
	}
	.bottom-bar {
	border-bottom: solid 1px #405f61;
	}
</style>
<div style="">
	
<?php
//$this->load->view('/header.php');


if ($this->session->flashdata('success')) {
	echo '<p class="success">' . $this->session->flashdata('success') . '</p>';
}
echo validation_errors('<p class="error">', '</p>');


if ($shouts) {
	echo '<ul>';
	foreach ($shouts as $shout) {
		$gravatar = 'http://www.gravatar.com/avatar.php?gravatar_id=' . md5(strtolower($shout->email)) . '&size=40';
		?>
		<div class="bottom-bar" id="shoutbox-div">
			<div style="float:left">
				<img src="<?php echo $gravatar ?>" alt="Gravatar" />
			</div>
			<div class="calibri" style="float:left;margin-left:5px;width:174px">
				<div style="float:left;color:#fff600"><?php echo $shout->name ?></div><div style="float:right">1:12am</div>
			</div>
			<div class="clear10"></div>
			<div class="calibri"><?php echo $shout->message ?></div>

			<div class="clear10"></div>
		</div>
		<div style="clear:both;height:15px"></div>
		

		<?php
	}
}
else {
	echo '<p class="error">No shouts found!</p>';
}


echo form_open('shouts/create'); ?>
	<h2>Shout!</h2>
	
	<div class="fname">
	<label for="name"><p>Name:</p></label>
	<input type="text" name="name" value="<?= set_value('name') ?>" />
	</div>
	<div class="clear"></div>
	<div class="femail">
	<label for="email"><p>Email:</p></label>
	<input type="text" name="email" value="<?= set_value('email') ?>" />
	</div>
	<div class="clear"></div>
	<textarea name="message" rows="5" cols="40"><?php echo set_value('message') ?></textarea>

	<p><input type="submit" value="Submit" /></p>
	<?php
echo form_close();
//$this->load->view('/footer.php');
?>
</div>
